package com.kpx.app.view;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.kpx.app.R;

/**
 * Created by congdy on 17/4/29.
 */

public class ViewLine extends ViewGroup {

    private final View view;
    private final Context context;

    public ViewLine(Context context) {
        super(context);
        this.context = context;
        view = View.inflate(context, R.layout.item_line,this);
    }

    public void setBack(int res){
        view.setBackgroundColor(context.getResources().getColor(res));
    }
    public void setSelected(boolean s){
        if(s){setBack(R.color.red_FF2048);} else setBack(R.color.white);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

    }
}
